using System;

namespace TravelAgent
{
    public partial class TravelAgentService
    {
        /// <remarks/>
        [System.Web.Services.WebMethodAttribute()]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.jakubmaly.cz/TravelAgentService/FindConnection", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)]
        [return: System.Xml.Serialization.XmlElementAttribute("connectionResponse", Namespace = "http://www.jakubmaly.cz/TravelAgentService/")]
        public ConnectionRPType FindConnection([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.jakubmaly.cz/TravelAgentService/")] ConnectionRQType connectionRequest)
        {
            return new ConnectionLookup().Lookup(connectionRequest);
        }
    }

    public partial class ConnectionRPType
    {
        [System.Xml.Serialization.SoapIgnore]
        [System.Xml.Serialization.XmlIgnore]
        public bool IsError
        {
            get
            {
                return this.Item is ConnectionRPTypeError;
            }
        }

        [System.Xml.Serialization.SoapIgnore]
        [System.Xml.Serialization.XmlIgnore]
        public ConnectionRPTypeConnections Connections
        {
            get
            {
                if (IsError)
                    return null;
                else
                    return (ConnectionRPTypeConnections) this.Item;
            }
            set
            {
                this.Item = value; 
            }
        }
    }

    public partial class ConnectionRQType
    {
        [System.Xml.Serialization.XmlIgnore]
        [System.Xml.Serialization.SoapIgnore]
        public DateTime ? ArrivalTime
        {
            get
            {
                if (ItemElementName == ItemChoiceType.arrivalTime)
                    return Item;
                else
                    return null;
            }
            set
            {
                if (value.HasValue)
                {
                    ItemElementName = ItemChoiceType.arrivalTime;
                    Item = value.Value;
                }
            }
        }

        [System.Xml.Serialization.XmlIgnore]
        [System.Xml.Serialization.SoapIgnore]
        public DateTime? DepartureTime
        {
            get
            {
                if (ItemElementName == ItemChoiceType.departureTime)
                    return Item;
                else
                    return null;
            }
            set
            {
                if (value.HasValue)
                {
                    ItemElementName = ItemChoiceType.departureTime;
                    Item = value.Value;
                }
            }
        }

    }
}